<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <title>上传</title>
    <link rel="stylesheet" type="text/css" href="../css/bootstrap/dist/css/bootstrap.min.css">
</head>

<body>
    <div id="stage">
        <div class="login-container">
            <p>账户登录</p>
            <form class="" role="form" id="upload-form" enctype="multipart/form-data">
                <input type="file" name="uploadfile" id="file">
                <input type="hidden" name="province_id" value="2">
                <input type="hidden" name="sessionid" value="tan2dz3zhvpj5eh71fm8pwcx3m5ud5ao">
            </form>
            <button class="btn" id="upload">上传</button>
        </div>
    </div>
</body>
<script src="../js/lib/jquery-3.1.0.min.js"></script>
<script>

    $('#upload').click(function(){
        var formdata=new FormData(document.getElementById('upload-form'));
        $.ajax({
            url:'http://m.sz404.com/api/importphone',
            type:'post',
            processData: false,
            data:formdata,
            contentType:false,
            success:function(data){console.log(data)},
            error:function(data){console.log(data)}
        })
    })
</script>

</html>